<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
	<title>支付成功</title>
	<link rel="stylesheet" type="text/css" href="css/public.css">
	<link rel="stylesheet" type="text/css" href="css/common.css">
</head>
<body>
	<div class="cont">
		<h2 class="unfinished"><span class="right"><img src="img/right.png" /></span>&nbsp;支付成功</h2>
		<div class="info big">
			<p class="name"><span>产品名称</span><span class="proName"></span></p>
			<p class="money"><span>金<b>金额</b>额</span><span class="proPrice"></span></p>
			<p class="code"><span>订单号码</span><span class="proCode"></span></p>
			<p class="time"><span>交易时间</span><span class="proTime"></span></p>
		</div>
		<div class="btn">
			<button class="emit">查看产品</button>
		</div>
	</div>
</body>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/app-common.js"></script>
<script>
	var orderid = localStorage.getItem("orderid");

	function getCode() {
		$.ajax({
			type: "get",
			url: APP_CONFIG.orderInfoUrl,
			data: {
				token: getUserToken(),
				order_id: orderid,
			},
			success: function(res) {
				//console.log(res);
				var proInfo = res.data;
				var paytime = moment(proInfo.payTime).format("YYYY-MM-DD  hh:mm:ss");
				if (proInfo.status == 2) {
					$(".proName").text(proInfo.body);
					$(".proPrice").text(((proInfo.order_fee) * 0.01).toFixed(2) + "元");
					$(".proCode").text(proInfo.out_trade_no);
					$(".proTime").text(paytime);
				}
			}
		});
	}

	getCode();

	$(".emit").click(function() {
		location.href = "customer_info.html";
	});
</script>
</html>
